<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActiveRecord::ConnectionAdapters::TransactionState</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActiveRecord::ConnectionAdapters::TransactionState 
            
                <span class="parent">&lt; 
                    
                    <a href="../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/activerecord/lib/active_record/connection_adapters/abstract/transaction_rb.html">activerecord/lib/active_record/connection_adapters/abstract/transaction.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TransactionState.html#method-i-committed-3F">committed?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TransactionState.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TransactionState.html#method-i-rolledback-3F">rolledback?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>S</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TransactionState.html#method-i-set_state">set_state</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    
      <!-- Section constants -->
      <div class="sectiontitle">Constants</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class="attr-name">VALID_STATES</td>
            <td>=</td>
            <td class="attr-value">Set.new([:committed, :rolledback, nil])</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
      </table>
    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [RW]
            </td>
            <td class='attr-name'>parent</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(state = nil)
            
            <a href="TransactionState.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/55686dd1be37d6eb57dc086e4bc72922f49b2e17/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L21" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">state</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@state</span> = <span class="ruby-identifier">state</span>
  <span class="ruby-ivar">@parent</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-committed-3F">
            
              <b>committed?</b>()
            
            <a href="TransactionState.html#method-i-committed-3F" name="method-i-committed-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-committed-3F_source')" id="l_method-i-committed-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/55686dd1be37d6eb57dc086e4bc72922f49b2e17/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L26" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-committed-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">committed?</span>
  <span class="ruby-ivar">@state</span> <span class="ruby-operator">==</span> <span class="ruby-value">:committed</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-rolledback-3F">
            
              <b>rolledback?</b>()
            
            <a href="TransactionState.html#method-i-rolledback-3F" name="method-i-rolledback-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-rolledback-3F_source')" id="l_method-i-rolledback-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/55686dd1be37d6eb57dc086e4bc72922f49b2e17/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L30" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-rolledback-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">rolledback?</span>
  <span class="ruby-ivar">@state</span> <span class="ruby-operator">==</span> <span class="ruby-value">:rolledback</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-set_state">
            
              <b>set_state</b>(state)
            
            <a href="TransactionState.html#method-i-set_state" name="method-i-set_state" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-set_state_source')" id="l_method-i-set_state_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/55686dd1be37d6eb57dc086e4bc72922f49b2e17/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L34" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-set_state_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_state</span>(<span class="ruby-identifier">state</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">VALID_STATES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">state</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Invalid transaction state: #{state}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@state</span> = <span class="ruby-identifier">state</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    